import React from 'react'
import { BrowserRouter, useRoutes } from 'react-router-dom'
const Home = React.lazy(() => import('../pages/home'))
const Detail = React.lazy(() => import('../pages/detail'))
const Search = React.lazy(() => import('../pages/search'))

const routes = [{
	path: '/',
	element: <Home></Home>
},{
	path: '/detail/:id',
	element: <Detail></Detail>
},{
	path: '/search',
	element: <Search></Search>
}]

const Router = () => {
	const App = () => useRoutes(routes)
	return (	
		<BrowserRouter>
			<App></App>
		</BrowserRouter>
	)
}

export default Router